<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
     <div id="app">
            <h1 id="text">{{message}}</h1>
            <button @click="handleClick">修改文本</button>
     </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        let vm = new Vue({
            el:"#app",
            data:{
                message:"hallo"
            },
            methods: {
                handleClick:function(){
                    this.message = 'xiao';// 看一下数据修改，视图是不是立刻更新，如果不是的话，说明视图更新异步
                    console.log(document.getElementById("text").innerHTML);// hallo
                    this.$nextTick(()=>{
                        console.log(document.getElementById("text").innerHTML); // xiao
                    })
                }
            },
        })
    </script>
</body>
</html>